<template>
   <div>
       <van-field  
       :label='label' 
       :type="type" 
       :placeholder="placeholder"
       v-model="content"
       
       />
   </div>
</template>

<script>
    export default {
        props:["label","type","placeholder","rule"],
        data() {
            return {
                content:''
            }
        },
        methods:{
            handlerulg(){
                const rue=new RegExp(this.rule)
                if(rue.test(this.content)){
                    this.$emit('inputChange', this.content)
                }
            }
        },
      
        watch: {
            content(){
                this.handlerulg()
            }
        }
    }
</script>

<style scoped>
.van-cell{
    font-size: 3.889vw;
   
}
</style>